{% extends 'base.html' %}
{% block title %}Staff detail{% endblock %}
{% block stylesheet %}
{{ block.super }}
{% endblock%}

{% block javascript %}
{{ block.super }}
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
    $('.delete').click(function() {
        var b = confirm("Do you really want to delete it?");
        if (b == false) {
            return false;
        }
    });
});
//]]>
</script>
{% endblock%}

{% block content %}
<h2>Staff detail</h2>

<div id="navi">
    <ul>
        <li><a href="{% url staff_list %}">staff list</a></li>
        <li><a href="{% url staff_change staff.id %}">staff change</a></li>
        <li><a href="{% url staff_delete staff.id %}" class="delete">staff delete</a></li>
    </ul>
</div>

<table class="detail">
    <tr>
        <th>이름</th>
        <th>성</th>
        <th>mobile phone</th>
        <th>email</th>
        <th>phone</th>
        <th>address</th>
    </tr>
    <tr>
        <td>{{ staff.first_name }}</td>
        <td>{{ staff.second_name }}</td>
        <td>{{ staff.mobilephone|default_if_none:"-" }}</td>
        <td>{{ staff.email|default_if_none:"-" }}</td>
        <td>{{ staff.phone|default_if_none:"-" }}</td>
        <td>{{ staff.address|default_if_none:"-" }}</td>
    </tr>
</table>

<h3>관련학교({{schools|length}})</h3>
<table id="school_list" class="tablesorter list">
<thead>
    <tr>
        <th>No.</th>
        <th>도명</th>
        <th>시명</th>
        <th>구별</th>
        <th>학교명</th>
        <th>영문 학교명</th>
        <th>Phone</th>
        <th>IP</th>
    </tr>
</thead>
<tbody>
{% load emc_filters %}
{% for school in schools %}
    <tr>
        <td>{{ forloop.counter }}</td>
        <td>{{ school.province|kr_province }}</td>
        <td>{{ school.local|default_if_none:"-" }}</td>
        <td>{{ school.stage|kr_stage }}</td>
        <td><a href="{% url school_detail school.id %}">{{ school.name }}_{{ school.stage }}</a></td>
        <td>{{ school.en_name|default_if_none:"-" }}</td>
        <td>{{ school.phone|default_if_none:"-" }}</td>
        <td>{{ school.ip }}</td>
    </tr>
{% endfor %}
</tbody>
</table>


{% endblock %}